package Client;

import java.rmi.RemoteException;

/**
 *
 * @author Bocman
 */
public class SetLocationThread extends Thread {

     long SetTime;
     static long TIME_FOR_SET_LOCATION = 60000;
     
     public SetLocationThread(){
     }

     public SetLocationThread(long TimeForSet){
         TIME_FOR_SET_LOCATION = TimeForSet;
     }

     public void run(){
        SetTime = System.currentTimeMillis();
        while (true){
            if (ClientMIDlet.getConnect()){
              if ((System.currentTimeMillis() - SetTime) > TIME_FOR_SET_LOCATION){
                SetTime = System.currentTimeMillis();
                try {
                    ClientMIDlet.setLocationUser();
                } catch (RemoteException ex) {
                }
              }
            }
        }
     }

}
